# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=eternal-scanner
pkgver=101.3979b0f
pkgrel=1
groups=('blackarch' 'blackarch-scanner' 'blackarch-exploitation')
pkgdesc='An internet scanner for exploit CVE-2017-0144 (Eternal Blue).'
arch=('any')
url='https://github.com/peterpt/eternal_scanner'
license=('MIT')
depends=('bash' 'masscan' 'metasploit')
makedepends=('git')
source=("$pkgname::git+https://github.com/peterpt/eternal_scanner.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"

  install -Dm 755 -t "$pkgdir/usr/bin/" escan elog
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname" *.md
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

